<?php

namespace app\common\model\server;

use app\common\contract\Token;

class JwtModel implements Token
{
    public function __construct()
    {
        $this->logic = model('logic.jwt');
    }

    //生成token
    public function generateToken($data)
    {
        return $this->logic->generateToken($data);
    }

    //获取token数据
    public function getPayload()
    {
        return $this->logic->getPayload();
    }

    //验证token
    public function checkToken($token)
    {
        return $this->logic->checkToken($token);
    }
}
